package com.example.demo.permission.menu.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.common.UserUtil;
import com.example.demo.permission.menu.pojo.Menu;
import com.example.demo.permission.menu.service.MenuService;
import com.example.demo.permission.user.pojo.LtUser;

@RestController
@RequestMapping("/config")
public class ConfigController {

	@Autowired
	MenuService menuService;

	@RequestMapping("/sysmenu")
	public List<Menu> sysmenu() {
		List<Menu> list = new ArrayList<Menu>();
		list = menuService.getMenuByUserId();
		return list;
	}

	@RequestMapping("/user")
	public LtUser currentUser() {
		return UserUtil.getCurrentUser();
	}

}
